﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace kba.modbus.master
{
    public partial class dlgReadCoils: Form
    {
        public dlgReadCoils()
        {
            InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void QuantityofCoils_TextChanged(object sender, EventArgs e)
        {
            int anInteger;
            try
            {
                if (QuantityofCoils.Text.Length > 1)
                {
                    anInteger = Convert.ToInt32(QuantityofCoils.Text);
                    if (anInteger > 2000 || anInteger < 1)
                    {
                        MessageBox.Show("Enter a Value between 1 and 2000", "Modbus Master", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
                    }
                }
            }
            catch (Exception ex)
            {                
                Console.WriteLine("{0} Exception caught.", ex);
            }

        }

        private void btnSend_Click(object sender, EventArgs e)
        {

        }

        private void btnRetry_Click(object sender, EventArgs e)
        {

        }

        private void checkBoxBroadcast_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void checkBoxCloseDialog_CheckedChanged(object sender, EventArgs e)
        {

        }
    }
}
